package com.sortingalgorithm;

import java.util.Random;

public class Test {

    int number = 500000;
    int [] test = new int[number];

    public Test() {
    }

    public void generateNum(){
        Random r = new Random();
        for(int i = 0;i < number;i++){
            test[i] = r.nextInt(100);
        }
    }

    @CalculateRuntime
    public void bubbleTest1(){
        int [] t = test.clone();
        BubbleSort.bubbleSort(t);
        printOut(t);


    }

    @CalculateRuntime
    public void insertTest(){
        int [] t = test.clone();
        InsertSort.insertSort(t);
        printOut(t);
    }

    @CalculateRuntime
    public void mergeTest(){
        int [] t = test.clone();
        MergeSort.sort(t);
        printOut(t);
    }

    @CalculateRuntime
    public void quickTest(){
        int [] t = test.clone();
        QuickSort.quickSort(t,0,t.length - 1);
        printOut(t);
    }

    @CalculateRuntime
    public void selectTest(){
        int [] t = test.clone();
        SelectSort.selectSort(t);
        printOut(t);
    }

    @CalculateRuntime
    public void heapTest(){
        int [] t = test.clone();
        HeapSort.heapSort(t);
        printOut(t);
    }

    public void printOut(int [] t){
//        System.out.println(Arrays.toString(t));
//        System.out.println("---------------------");
    }


}
